<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>{$title}</title>
<link rel="shortcut icon" href="__PUBLIC__/admin/assets/ico/favicon.ico" type="image/x-icon" />
<link href="__PUBLIC__/admin/assets/css/bootstrap.min.css" rel="stylesheet">
<script src="__PUBLIC__/admin/assets/js/jquery-2.1.1.min.js"></script>
<style>
* {
	font-weight: normal;
}
</style>
<body>
<div style="width:480px; padding:10px;">
<table class="table">
  <thead>
    <tr>
      <th style="width:180px;"> 订单ID</th>
      <th>{$order['order_id']}</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <th scope="row">下单时间</th>
      <th>{:date('Y-m-d H:i:s',$order['time'])}</th>
    </tr>
    <tr>
      <th scope="row">分销会员</th>
      <th>{$order['uid']} <a href="{:U("/Yzadmin/User/update/id/".$order['uid'])}" target="_blank">more</a></th>
    </tr>
    <tr>
      <th scope="row">商品ID</th>
      <th>{$order['item_id']}</th>
    </tr>
        <tr>
      <th scope="row">商品</th>
      <th>{$order['title']}</th>
    </tr>

    <tr>
      <th scope="row">购买套餐</th>
      <th>{$order['suk_name']}</th>
    </tr>
    <tr>
      <th scope="row">套餐价格</th>
      <th>{$order['suk_price']}</th>
    </tr>
    <tr>
      <th scope="row">提成</th>
      <th>{$order['suk_ticheng']}</th>
    </tr>
    <tr>
      <th scope="row">姓名</th>
      <th>{$order['name']}</th>
    </tr>
    <tr>
      <th scope="row">电话</th>
      <th>{$order['tel']}</th>
    </tr>
    <tr>
      <th scope="row">收货地址</th>
      <th>{$order['province']}{$order['city']}{$order['area']}{$order['xxdz']}</th>
    </tr>
    <tr>
      <th scope="row">收款方式</th>
      <th>{$order['identity']}</th>
    </tr>
    <tr>
      <th scope="row">ip</th>
      <th>{$order['ip']}</th>
    </tr>
    <tr>
      <th scope="row">提交页面</th>
      <th>{$order['ll_url']}</th>
    </tr>
  <form action="" method="post">
    <input type="hidden" name="id" value="{$order.id}">
    <tr>
      <th scope="row">订单状态</th>
      <td><?php if($order['type']!=='4') {?>
        <select name="type" id="type">
          <?php }?>
          <?php if($order['type']==1 || $order['type']==9){?>
          <option value ="2" <?php if($order['type']==2){?>selected="selected"  <?php } ?>>已电话确认,等待发货</option>
          <option value="9" <?php if($order['type']==9){?>selected="selected"  <?php } ?>>等待确定</option>
          <option value="7" <?php if($order['type']==7){?>selected="selected"  <?php } ?> >无效订单</option>
          <?php }else if($order['type']==2){?>
          <option value ="3" <?php if($order['type']==3){?>selected="selected"  <?php } ?> >已发货</option>
          <?php }else if($order['type']==3){?>
          <option value="4" <?php if($order['type']==4){?>selected="selected"  <?php } ?> >已收货</option>
          <option value="5" <?php if($order['type']==5){?>selected="selected"  <?php } ?> >已拒收</option>
          <?php }else if($order['type']==4){?>
          
                    已结算,状态已不可操作
                    
          <?php }else{?>
          <option value="7">无效订单</option>
          <?php }?>
          <?php if($order['type']!=='4') {?>
        </select>
        <?php } ?></td>
    </tr>
    <tr class="kd">
      <th scope="row">快递公司</th>
      <td><select name="com">
          <option value ="yuantong" <?php if($order['com']=="yuantong"){?>selected="selected"  <?php } ?>  >圆通快递</option>
          <option value ="shentong" <?php if($order['com']=="shentong"){?>selected="selected"  <?php } ?> >申通快递</option>
          <option value="shunfeng" <?php if($order['com']=="shunfeng"){?>selected="selected"  <?php } ?> >顺丰快递</option>
          <option value="yunda" <?php if($order['com']=="yunda"){?>selected="selected"  <?php } ?> >韵达快递</option>
          <option value="zhongtong" <?php if($order['com']=="zhongtong"){?>selected="selected"  <?php } ?> >中通快递</option>
          <option value="ems" <?php if($order['com']=="ems"){?>selected="selected"  <?php } ?> >EMS</option>
        </select></td>
    </tr>
    <tr class="kd">
      <th scope="row">快递单号</th>
      <td><input type="text" name="nu" value="{$order.nu}" ></td>
    </tr>
    <tr id="content">
      <th scope="row">客服备注</th>
      <td><textarea name="content"  style="height:80px; width:100%">{$order.content}</textarea></td>
    </tr>
    <tr>
      <th scope="row"></th>
      <td><input type="submit"  id="sub" value="处理"></td>
    </tr>
  </form>
    </tbody>
  
</table>
<script> 
     $(function(){
		$(".kd").hide();
		$("#content").hide();
		var type=$("#type").children('option:selected').val();
	    order_type(type);
     $("#type").change(function(){
        var select_val = $(this).children('option:selected').val(); 
		order_type(select_val);
     });
	 
	 $("#sub").click(function(){
		  var type= $("#type").val(); 
		  if(type==4){
			    alert("本操作将直接给会员加款,请确认!");
			  }
		 });
	 
	 
   });  
 
  function order_type(type){
	   if(type==7 || type==2 || type==9){
		    $(".kd").hide();
		    $("#content").show();
		 }else{
			$(".kd").show();
		    $("#content").show();
		  }
	  }
</script>
</body>
</html>